package com.my.autoassociate.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.gitee.mayan50.autoassociate.annotation.OneToMany;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
@ToString
public class Pirates {

    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Long captain;
    private String remark;

    @TableField(exist = false)
    @OneToMany(column = "id", associateColumn = "pirates_id")
    List<User> users;

}
